package jjn.carl.string;

import java.util.Arrays;

/**
 * @author Jjn
 * @since 2023/7/5 11:39
 */
public class LeetCode344 {
    public void reverseString(char[] s) {
        int left = 0, right = s.length - 1;
        while (left < right) {
            char temp = s[left];
            s[left] = s[right];
            s[right] = temp;
            left++;
            right--;
        }
    }
    
    public static void main(String[] args) {
        String s = "aabbcc";
        char[] input = s.toCharArray();
        new LeetCode344().reverseString(input);
        System.out.println("input = " + Arrays.toString(input));
    }
}
